package net.zisen.cloud.order.client;

import net.zisen.cloud.base.msg.ResultMsg;
import net.zisen.cloud.order.fallback.OrderClientFallbackFactory;
import net.zisen.cloud.order.model.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author tim/278002989@qq.com
 * @Classname OrderClient
 * @Description TODO
 * @Date 2019-05-17 15:31
 */
@FeignClient(value = "PING-ORDER-PROVIDER", fallbackFactory = OrderClientFallbackFactory.class)
public interface OrderServiceClient {

    /**
     * 创建订单
     *
     * @param uid
     * @param goodsId
     * @param quality
     * @return
     */
    @RequestMapping(value = "order", method = RequestMethod.POST)
    ResultMsg<Order> addOrder(@RequestParam Long uid, @RequestParam Long goodsId, @RequestParam Integer quality);


    /**
     * 订单支付
     *
     * @param orderNum
     * @return
     */
    @RequestMapping(value = "pay/order", method = RequestMethod.GET)
    ResultMsg payOrder(@RequestParam(name = "num") String orderNum);

}
